<?php

class Admin_ProductController extends Zend_Controller_Action{

    public function init(){
		parent::init();
        $layoutPath = APPLICATION_PATH  . '/templates/admin/default';
        $option = array ('layout' => 'index',
                   'layoutPath' => $layoutPath );
        Zend_Layout::startMvc ($option );

	}
    public function indexAction(){
        $products = new Admin_Model_Product();
        $this->view->products=$products->fetchAll();
    }

    public function addAction(){
        /*$san_pham=new Admin_Model_Product();
        $form = new Admin_Form_Article();
        $form->submit->setLabel('Add');
        $this->view->form = $form;
        if ($this->getRequest()->isPost()) {
        $formData = $this->getRequest()->getPost();
        if ($form->isValid($formData)) {
        $artist = $form->getValue('artist');
        $title = $form->getValue('title');
        $albums = new Application_Model_DbTable_Albums();
        $albums->addAlbum($artist, $title);
        $this->_helper->redirector('index');
        } else {
        $form->populate($formData);
        }
        }*/
        /*$baiviet = new Admin_Model_Article();
        $this->view->article = $baiviet->fetchAll();
        foreach($this->article as $bv)
        {
            echo $bv->ma;
        }
        exit;*/
        $form = new Admin_Form_Product();
        //$form->submit->Label = 'Add';
        $this->view->form = $form;
    }
    public function editAction(){
        //
    }
    public function deleteAction(){
        //
    }
}
 
